home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programmer's Power Pack
/
Delphi Volume 1.iso
/
s_to_z
/
wmapdemo
/
data.z
/
FINDPT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-03-09
|
2KB
|
71 lines
unit Findpt;
interface
uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
StdCtrls, ExtCtrls,Dialogs;
type
TFindDlg = class(TForm)
OKBtn: TBitBtn;
CancelBtn: TBitBtn;
HelpBtn: TBitBtn;
Bevel1: TBevel;
RadioGroup1: TRadioGroup;
RBLat: TRadioButton;
RBLong: TRadioButton;
RBLabel: TRadioButton;
RBTag: TRadioButton;
Label1: TLabel;
Searchtext: TEdit;
procedure OKBtnClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FindDlg: TFindDlg;
implementation
uses Mapmain,worldmap;
{$R *.DFM}
procedure TFindDlg.OKBtnClick(Sender: TObject);
var
Index : integer;
APoint : TPointObject;
begin
APoint := TPointObject.Create;
try
with Mapform.Worldmap1 do begin
if RBLat.checked then
Index := FindPoint(ftLat,searchtext.text,0)
else if RBLong.checked then
Index := FindPoint(ftLong,searchtext.text,0)
else if RBLabel.checked then
Index := FindPoint(ftLabel,searchtext.text,0)
else if RBTag.checked then
Index := FindPoint(ftTag,searchtext.text,0);
if Index <> -1 then begin
GetPoint(Apoint,Index);
ZoominbyFactor(Apoint.dlat div 60,Apoint.dlong div 60,1);
end else
messagedlg('No points found',mtInformation,[mbOk],0);
end;
finally
Apoint.free;
end;
end;
procedure TFindDlg.FormClose(Sender: TObject; var Action: TCloseAction);
begin
action := caFree;
end;
end.